<script lang="ts" setup>
  import { Game } from '@/types/game';

  defineProps<{
    gameInfo: Game;
  }>();
</script>

<template>
  <div class="game-card">
    <div class="game-card-icon">
      <img :src="gameInfo.logo" />
    </div>
    <div class="game-card-info">
      <div class="game-card-name">
        <div class="game-card-name-c">
          {{ gameInfo.name }}
        </div>
      </div>
      <a-tag
        v-if="gameInfo.gameType === 1 && gameInfo.childGameCount === 1"
        color="blue"
      >
        父比赛
      </a-tag>
      <a-tag
        v-if="gameInfo.gameType === 1 && gameInfo.childGameCount === 2"
        color="orange"
      >
        多阶段赛事
      </a-tag>
    </div>
  </div>
</template>

<style lang="less" scoped>
  .game-card {
    display: flex;
    align-items: center;
    &-icon {
      width: 60px;
      height: 60px;
      display: flex;
      align-items: center;
      justify-content: center;
      img {
        max-width: 100%;
        max-height: 100%;
      }
    }

    &-info {
      flex: 1;
      min-width: 0;
      margin-left: 10px;
    }

    &-name {
      font-size: 15px;
      font-weight: 500;
      display: flex;

      &-c {
        flex: 1;
        margin-right: 6px;
      }
    }

    &-desc {
      color: var(--color-text-2);
    }
  }
</style>
